bnjmn.

nice feature of sets

2025-05-02

#microposts

TIL you can check if a reference is the same with sets in JS

const a = {v: 2};
const b = {v: 2};
const s = new Set();
s.add(a);
s.has(a); // true
s.has(b); // false